<?php

class Application_Form_VenteForm extends Zend_Form
{

	public function init()
	{
		$this->setName('page_vente');

		$codebar = new Zend_Form_Element_Hidden('codebar');
		$codebar->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$login = new Zend_Form_Element_Hidden('login');
		$login->setAttrib('id','login')
		->setValue(NULL)
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$selected_products = new Zend_Form_Element_Hidden('selected_products');
		$selected_products->setAttrib('id','selected_products')
		->setValue(NULL)
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$type = new Zend_Form_Element_Hidden('type');
		$type->setAttrib('id','type')
		->setValue(0)
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$selected_qqties = new Zend_Form_Element_Hidden('selected_qqties');
		$selected_qqties->setAttrib('id','selected_qqties')
		->setValue(NULL)
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$code = new Zend_Form_Element_Password('password_groupe');
		$code->setAttrib('id','password_groupe')
		->setAttrib("autocomplete", "off")
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$login_keyboard = new Zend_Form_Element_Text('login_keyboard');
		$login_keyboard->setAttrib('id','login_keyboard')
		->setAttrib("autocomplete", "off")
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$button = new Zend_Form_Element_Button('total');
		$button->setAttrib('id','total')
		->setLabel('0 €')
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$reset = $this->createElement('reset', 'reset', array('ignore' => true));
		$reset->setAttrib('onclick', "window.location.reload()")
		->setLabel('Annuler')
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$send = new Zend_Form_Element_Submit('sell');
		$send->setLabel('Vendre')
		->setDecorators(array('ViewHelper','FormErrors','Errors'));

		$this->addElements(array($codebar,$code,$login_keyboard,$login,$type,$selected_products,$selected_qqties,$button,$reset,$send));
	}
}